import 'package:xin_he/generated/json/base/json_field.dart';
import 'package:xin_he/generated/json/xin_he_shop_cart_goods_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class XinHeShopCartGoodsEntity {
	String? sellerUserId;
	String? sellerName;
	int? amount;
	double? sumFee;
	int? freightFee;
	int? goodsSumFee;
	bool isSelected = false;
	int? zoneType;
	List<XinHeShopCartGoodsOrderItems>? orderItems;

	XinHeShopCartGoodsEntity();

	factory XinHeShopCartGoodsEntity.fromJson(Map<String, dynamic> json) => $XinHeShopCartGoodsEntityFromJson(json);

	Map<String, dynamic> toJson() => $XinHeShopCartGoodsEntityToJson(this);

	XinHeShopCartGoodsEntity copyWith({String? sellerUserId, String? sellerName, int? amount,int? zoneType, double? sumFee, int? freightFee, int? goodsSumFee, List<XinHeShopCartGoodsOrderItems>? orderItems}) {
		return XinHeShopCartGoodsEntity()
			..sellerUserId= sellerUserId ?? this.sellerUserId
			..sellerName= sellerName ?? this.sellerName
			..amount= amount ?? this.amount
			..zoneType= amount ?? this.zoneType
			..sumFee= sumFee ?? this.sumFee
			..freightFee= freightFee ?? this.freightFee
			..goodsSumFee= goodsSumFee ?? this.goodsSumFee
			..orderItems= orderItems ?? this.orderItems;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class XinHeShopCartGoodsOrderItems {
	String? orderItemId;
	String? fUserId;
	String? fGoodsId;
	String? goodsName;
	String? goodsIconPath;
	double? goodsPrice;
	int? goodsAmount;
	String? goodsSellerUserId;
	String? goodsSellerName;
	int? zoneType;
  bool isSelected = false;
	XinHeShopCartGoodsOrderItems();

	factory XinHeShopCartGoodsOrderItems.fromJson(Map<String, dynamic> json) => $XinHeShopCartGoodsOrderItemsFromJson(json);

	Map<String, dynamic> toJson() => $XinHeShopCartGoodsOrderItemsToJson(this);

	XinHeShopCartGoodsOrderItems copyWith({String? orderItemId, String? fUserId, String? fGoodsId, String? goodsName, String? goodsIconPath, double? goodsPrice, int? goodsAmount, String? goodsSellerUserId, String? goodsSellerName, int? zoneType}) {
		return XinHeShopCartGoodsOrderItems()
			..orderItemId= orderItemId ?? this.orderItemId
			..fUserId= fUserId ?? this.fUserId
			..fGoodsId= fGoodsId ?? this.fGoodsId
			..goodsName= goodsName ?? this.goodsName
			..goodsIconPath= goodsIconPath ?? this.goodsIconPath
			..goodsPrice= goodsPrice ?? this.goodsPrice
			..goodsAmount= goodsAmount ?? this.goodsAmount
			..goodsSellerUserId= goodsSellerUserId ?? this.goodsSellerUserId
			..goodsSellerName= goodsSellerName ?? this.goodsSellerName
			..zoneType= zoneType ?? this.zoneType;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}